package com.shiwaixiangcun.customer.ui.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;

import com.shiwaixiangcun.customer.R;
import com.shiwaixiangcun.customer.adapter.AdapterRescue;
import com.shiwaixiangcun.customer.base.BaseActivity;
import com.shiwaixiangcun.customer.entity.RescueWayBean;
import com.shiwaixiangcun.customer.widget.ChangeLightImageView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 救助方式
 * @author Administrator
 */

public class RescueWayActivity extends BaseActivity {

    @BindView(R.id.back_left)
    ChangeLightImageView mBackLeft;
    @BindView(R.id.tv_page_name)
    TextView mTvPageName;
    @BindView(R.id.rv_rescue_way)
    RecyclerView mRvRescueWay;

    AdapterRescue mAdapterRescue;
    List<RescueWayBean> mList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rescue_way);
        ButterKnife.bind(this);
        initData();
        initViewAndEvent();
    }

    private void initViewAndEvent() {
        mTvPageName.setText("救助方式");
        mAdapterRescue = new AdapterRescue(mList);
        mRvRescueWay.setLayoutManager(new LinearLayoutManager(this));
        mRvRescueWay.setAdapter(mAdapterRescue);
    }

    private void initData() {
        mList = new ArrayList<>();
        RescueWayBean watch = new RescueWayBean("智能手表", "世外生活推出的智能手表不仅能测心率、定位、通话，还连通了小镇智慧中心，当您遇到紧急情况直接按下SOS按钮即可一键求助"
                , R.mipmap.icon_rescue_5);
        RescueWayBean beeper = new RescueWayBean("无线呼叫器",
                "无线呼叫器安装在家里方便的位置，当发生紧急情况一键求助，小镇智慧中心即可收到消息并立即派人前来解决，子女再也不用担心独居老人的安全问题了",
                R.mipmap.icon_rescue_1);
        RescueWayBean ambulance = new RescueWayBean("救护车救助", "如果您在小镇内发生健康问题，直接拨打电话400-999-8871，24小时医护到家为您服务",
                R.mipmap.icon_rescue_2);
        RescueWayBean pile = new RescueWayBean("应急桩",
                "小镇内闲逛遇到紧急情况，直接找到就近的应急桩，按下求助按钮，小镇智慧中心即可看到并帮您解决问题，目前应急桩正在增加中，请耐心等待",
                R.mipmap.icon_rescue_3);
        RescueWayBean helicopter = new RescueWayBean("直升机", "危重突发情况，通过各种方式先联系到小镇智慧中心，若智慧中心解决不了，将会用直升机转移到相关机构，目前直升机应急力量正在筹建中",
                R.mipmap.icon_rescue_4);


        mList.add(watch);
        mList.add(beeper);
        mList.add(ambulance);
        mList.add(pile);
        mList.add(helicopter);


    }

    @OnClick(R.id.back_left)
    public void onViewClicked() {
        finish();
    }

}
